<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Text" %>

<script runat=server>

   Sub Page_Load(Sender as Object, E as EventArgs) 
      Dim i As Integer
      Dim garbage As New StringBuilder
    
      If Application("garbage") Is Nothing Then
        Dim c As Integer

        For c=1 to 1000
          garbage = garbage.Append("xxxxxxxxxx")
        Next c

        Application("garbage") = garbage
      Else
        garbage = Application("garbage")
      End If

      For i=1 to 500
         ' Make sure we create a unique entry
         Application(i.ToString + DateTime.Now.ToString("r")) = (garbage.ToString() + DateTime.Now.ToString("r"))
      Next i

      Dim p as ProcessInfo 
      p = ProcessModelInfo.GetCurrentProcessInfo()

      ProcessID.Text = p.ProcessID.ToString()

   End Sub

</script>

<html>
   <body>
      <h2>The Process ID serving this request is: <asp:label id="ProcessID" forecolor=red runat=server/> </h2>
      <h2>There are <%=Application.Count.ToString()%> items in Application state memory.</h2>
   </body>
</html>